package string;

import java.util.Arrays;

public class SplitDemo {
    public static void main(String[] args) {
        String str = "abc123def456ghi";
        String[] arr = str.split("[0-9]+");
        System.out.println(Arrays.toString(arr));
        str = "abc==def=ghi";
        arr = str.split("=");
        System.out.println(Arrays.toString(arr));
        str = "=abc=def=ghi";
        arr = str.split("=");
        System.out.println(Arrays.toString(arr));
        str = "abc=def=ghi=====";
        arr = str.split("=");
        System.out.println(Arrays.toString(arr));

        String name = "123.jpg";
        String[] names = name.split("\\.");//注意转译符
        System.out.println(Arrays.toString(names));
        long ms = System.currentTimeMillis();
        name = String.valueOf(ms) + "." + names[1];
        System.out.println(name);
    }
}
